package org.summerframework.core.page;

import com.fasterxml.jackson.annotation.JsonIgnore;
import org.summerframework.core.base.result.ResultDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.List;

/**
 * 封装分页结果
 *
 * @author 石超
 */
@Getter
@Setter
public class PageResult<T> extends ResultDTO<List<T>> implements Serializable {

    private static final long serialVersionUID = 537530121615796555L;
    /**
     * 总记录数
     */
    @ApiModelProperty(value = "总记录数")
    private long totalItem = 0;

    /**
     * 当前页码
     */
    @ApiModelProperty(value = "当前页码")
    private long pageIndex = 1;

    /**
     * 每页的记录数
     */
    @ApiModelProperty(value = "每页的记录数")
    private long pageSize = 20;

    /**
     * 总页数
     */
    @ApiModelProperty(value = "总页数")
    private long totalPage;

    /**
     * 开始行
     */
    @JsonIgnore
    @ApiModelProperty(value = "开始行")
    private long startRow;

}
